﻿@using Classified.Service
@model IEnumerable<Classified.Domain.Entities.ClassifiedAd>
<div class="">
    <div class="green-title">
        Related Ads</div>
    <ul id="mycarousel" class="thumbnails jcarousel-skin-tango related-ads">
        @foreach (var item in Model)
        {
            <li class="span2">
                @if (item.ClassifiedPicture.Count() == 0)
                {
                
                    <a class="thumbnail" href="@Url.Action("Details", "ClassifiedAds", new { id = item.Id, seName = SeService.GetSeName(item.Title) })">
                        <img src="/Images/110/80/images/no-image.jpg" alt="@item.Title" /></a>
                   
                   
                    
               
                }
                else
                {
              

                    <a class="thumbnail" href="@Url.Action("Details", "ClassifiedAds", new { id = item.Id, seName = SeService.GetSeName(item.Title) })">
                        <img src="/Images/110/80/classified/@item.ClassifiedPicture.FirstOrDefault().ImageGuid" alt="@item.Title" /></a>
                    
                   
              
                }
                <a class="text-info" href="@Url.Action("Details", "ClassifiedAds", new { id = item.Id, seName = SeService.GetSeName(item.Title) })">
                    @if (item.Title.Length > 30)
                    {
                        <text>
                        @item.Title.Substring(0, 30)...
                        </text>
                    }
                    else
                    {
                        <text>
                        @item.Title
                        </text>
                    }
                    <br />
                    @if (item.Price != 0)
                    {
                        <span class="price"> @SeService.GetCurrentCode(item.Id) @item.Price</span>
                    }</a></li>
        }
    </ul>
</div>
